import service from './request';

//*  注册接口
export function user_register( params = { } ) {
    return service.post('/user/register', params )
}

//*  登录接口
export function user_login( params = { } ) {
    return service.post('/user/login', params )
}

//*  轮播图接口
export function index_banner( params = { } ) {
    return service.get('/index/banner', {params} )
}

//*  首页导航
export function index_nav( params = { } ) {
    return service.get('/index/nav', {params} )
}

//*  推荐列表接口
export function index_goodlist( params = { } ) {
    return service.get('/index/goodlist', {params} )
}

//*  一级分类接口
export function category_list( params = { } ) {
    return service.get('/category/list', {params} )
}

//*  二三级分类接口
export function category_subcate( params = { } ) {
    return service.get('/category/subcate', {params} )
}

//*  按分类搜索
export function good_list( params = { } ) {
    return service.get('/good/list', {params} )
}

//*  按关键词搜索
export function good_search( params = { } ) {
    return service.get('/good/search', {params} )
}

//*  商品--详情
export function good_goodinfo( params = { } ) {
    return service.get('/good/goodinfo', {params} )
}

//*  热门搜索
export function good_hotsearch( params = { } ) {
    return service.get('/good/hotsearch', {params} )
}

//*  商品--收藏列表
export function good_favlist( params = { } ) {
    return service.get('/good/favlist', {params} )
}

//*  商品--收藏  userid 用户id 必须传 , goodid 商品id 必须传
export function good_fav( params = { } ) {
    return service.post('/good/fav', params )
}

//*  商品--取消收藏  userid 用户id 必须传 , goodid 商品id 必须传
export function good_unfav( params = { } ) {
    return service.post('/good/unfav', params )
}

//*  购物车列表   userid 用户id 必须传
export function shopcart_list( params = { } ) {
    return service.get('/shopcart/list', {params} )
}

//*  购物车清空
export function shopcart_clear( params = { } ) {
    return service.post('/shopcart/clear', params )
}

//*  购物车数量加一   userid 用户id 必须传 , goodid 商品id 必须传
export function shopcart_add( params = { } ) {
    return service.post('/shopcart/add', params )
}

//*  购物车数量减一   userid 用户id 必须传 , goodid 商品id 必须传
export function shopcart_sub( params = { } ) {
    return service.post('/shopcart/sub', params )
}